<?php
$this->breadcrumbs=array(
	'用户',
	'管理',
);

$this->menu=array(
//	array('label'=>'List User', 'url'=>array('index')),
//	array('label'=>'Create User', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('user-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>用户管理</h1>


<?php echo CHtml::link('高级搜索','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
//		'id',
    array('name'=>'id','htmlOptions'=>array('width'=>'20px')),
//		'username',
    array('name'=>'username', 'type'=>'raw', 'value'=>'CHtml::link($data->username, array("view", "id"=>$data->id), array("target"=>"_blank"))'),
//		'password',
		'realname',
		'tel',
//		'sex',
    array('name'=>'sex', 'value'=>'$data->sex == User::SEX_FEMALE ? "女" : "男"', 'filter'=>User::model()->getSexOptions(), 'htmlOptions'=>array('width'=>'45px')),
		
//		'class_id',
    array('name'=>'class_id', 'value'=>'$data->class->class_name', 'filter'=>ClassInfo::model()->getClassInfoList(), 'htmlOptions'=>array('width'=>'112px')),
//		'status_id',
		array('name'=>'status_id', 'value'=>'$data->status->status_name', 'filter'=>StatusType::model()->getStatusTypeList(), 'htmlOptions'=>array('width'=>'55px')),
//		'create_time',
    array('name'=>'create_time', 'htmlOptions'=>array('width'=>'65px')),
		
		
		array(
			'class'=>'CButtonColumn',
		  'template'=>'{update}{delete}',
		  'htmlOptions'=>array('width'=>'30px'),
			'headerHtmlOptions'=>array('width'=>'34px'),
		),
	),
)); ?>
